package com.gyp.manager;

import com.gyp.config.properties.WxChatConfig;
import com.gyp.constant.RedisKeyConstant;
import com.gyp.rpc.WeChatClient;
import com.gyp.rpc.request.GetTokenReq;
import com.gyp.rpc.response.AccessTokenResponse;
import lombok.RequiredArgsConstructor;
import org.redisson.api.RBucket;
import org.redisson.api.RedissonClient;
import org.springframework.stereotype.Component;

@RequiredArgsConstructor
@Component
public class WeChatManager {

    private final RedissonClient redissonClient;
    private final WxChatConfig wxChatConfig;
    private final WeChatClient weChatClient;

    public String getUserInfo(String code){
        RBucket<String> bucket = redissonClient.getBucket(RedisKeyConstant.WECHAT_TOKEN_PREFIX);
        if(bucket.isExists()){
            return bucket.get();
        }
        return null;
    }

}
